﻿///系统登陆窗体
Ext.ns("Tk");
Tk.Login=Ext.extend(Ext.form.FormPanel,{
					border:false
					,frame:true
					,labelWidth:80
					,url:'formerrors.php'
					,initComponent:function(){
						  var config = {
							baseCls: 'x-plain',
							
							defaultType: 'textfield',
							///表单输入
							items: [
								{
									fieldLabel: '登陆名',
									allowBlank: false,
									width:200,
									
									blankText:'用户名不能为空',
									name: 'UserName',
									hideMode:'display'
								},
								{
									 width:200,
									allowBlank: false,
									fieldLabel:'密码',
									blankText:'密码不能为空',
									name: 'PassWord',
									inputType: 'password'
								}
							]
							///表单按钮
							,buttons:[{
									text:'登陆'
									,formBind:true
									,scope:this
									,handler:this.submit
								}]
							}; // eo config object
											
							Ext.apply(this, Ext.apply(this.initialConfig, config)); 
							Tk.Login.superclass.initComponent.apply(this, arguments);
						}
						,submit:function()
						{
							///
							alert("开始提交");
							this.getForm().submit({
								url:this.url
								,scope:this
								,success:this.onSuccess
								,params:{cmd:'save'}
								,waitMsg:'系统数据处理中...'
							});
						}
						,onSuccess:function(form, action) {
								Ext.Msg.show({
								title:'Success'
								,msg:'Form submitted successfully'
								,modal:true
								,icon:Ext.Msg.INFO
								,buttons:Ext.Msg.OK
								});
						} // eo function onSuccess
					
					});
Ext.reg('Tk.Login', Tk.Login);

Tk.LoginWin=function(){ 
	var lw=	new Ext.Window({
        width: 350,
        title:'系统登陆',
        height:200,
        layout: 'fit',
        constrain:true,
        closable:true,
        collapsedCls:"x-plain",
        maskDisabled:true,
        bodyStyle:'padding:5px;',
        buttonAlign:'center',
        modal:true,
        items: {xtype:"Tk.Login"}
    })
	return lw;
}

